<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: checkout_payment_iframe.php 161 2013-09-22 07:53:36Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 161 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-22 07:53:36 +0000 (Sun, 22 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

include ('includes/application_top.php');

// include needed functions
require_once (DIR_FS_INC.'inc.calculate_tax.php');
require_once (DIR_FS_INC.'inc.address_label.php');

$smarty = new Smarty;
// include boxes
require (DIR_FS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/source/boxes.php');


// if the customer is not logged on, redirect them to the login page
if (!isset ($_SESSION['customer_id'])) {
	redirect(href_link(FILENAME_LOGIN, '', 'SSL'));
}

if ($_SESSION['customers_status']['customers_status_show_price'] != '1') {
	redirect(href_link(FILENAME_DEFAULT, '', ''));
}


if ((not_null(MODULE_PAYMENT_INSTALLED)) && (!isset ($_SESSION['payment']))) {
	redirect(href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}

// avoid hack attempts during the checkout procedure by checking the internal cartID
if (isset ($_SESSION['cart']->cartID) && isset ($_SESSION['cartID'])) {
	if ($_SESSION['cart']->cartID != $_SESSION['cartID']) {
		redirect(href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
	}
}
require (DIR_WS_INCLUDES . 'header.php');
// load selected payment module
require (DIR_WS_CLASSES.'payment.php');

$payment_modules = new payment($_SESSION['payment']);

// load the selected shipping module
require (DIR_WS_CLASSES.'shipping.php');
$shipping_modules = new shipping($_SESSION['shipping']);

require (DIR_WS_CLASSES . 'order_total.php');
require (DIR_WS_CLASSES.'order.php');
$order = new order();


$order_total_modules = new order_total();
$order_total_modules->process();

$iframe_url = $payment_modules->iframeAction();

if ($iframe_url =='')
	redirect(href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

$smarty->assign('iframe_url', $iframe_url);

$smarty->assign('language', $_SESSION['language']);
$smarty->caching = false;

$main_content = '<iframe src="'.$iframe_url.'" width="100%" height="750" name="_top" frameborder="0"></iframe>';


$smarty->assign('language', $_SESSION['language']);
$smarty->assign('main_content', $main_content);
$smarty->caching = false;
if (!defined('RM'))
	$smarty->loadFilter('output', 'note');
$smarty->loadFilter('output','trimwhitespace');
$smarty->display(CURRENT_TEMPLATE . '/index.html');
include ('includes/application_bottom.php');
?>